package routers

import (
	"github.com/gin-gonic/gin"
)

type Option func(*gin.Engine)

var options = []Option{}

func IncludeRouters(opt ...Option) {
	options = append(options, opt...)
}
func Init() *gin.Engine {
	r := gin.Default()
	r.NoMethod(HandleNotFound)
	r.NoRoute(HandleNotFound)
	r.Use(ErrHandler())

	for _, opt := range options {
		opt(r)
	}
	return r
}
